/************
Ten tac gia : Ly Thien kim
Ngay tao : 8/16/2011
Noi dung : Delete 1 Complaint
************/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE NAME = 'sp_DeleteComplaint')
BEGIN
	DROP PROC sp_DeleteComplaint
END
GO
CREATE PROC sp_DeleteComplaint
	@ID				int,
	@IDUSER			int,
	@Result			int out
	AS
	BEGIN
		IF EXISTS (SELECT * FROM COMPLAINT_REG WHERE  @ID = ID and @IDUSER = IDUSER)
		BEGIN
			DELETE FROM COMPLAINT_REG
			WHERE @ID = ID and @IDUSER = IDUSER
			SET @RESULT = 1
		END
		ELSE 
		BEGIN
			SET @RESULT = 0
		END
	END
